package com.wswy.wyjk.ui.practice.dialog

import android.content.Context
import android.os.Bundle
import android.support.v7.app.AppCompatDialog
import android.view.Window
import com.wswy.wyjk.R
import kotlinx.android.synthetic.main.dialog_exam_submit.*

class ExamSubmitDialog(context: Context,private val undoneCount:Int,private val submitCallback : (()->Unit?)) : AppCompatDialog(context) {


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        window?.requestFeature(Window.FEATURE_NO_TITLE)

        setCancelable(false)
        setCanceledOnTouchOutside(false)

        setContentView(R.layout.dialog_exam_submit)

        tv_exam_submit_hint.text = context.getString(R.string.exam_submit_hint,undoneCount)

        btn_cancel.setOnClickListener {
            dismiss()
        }

        btn_confirm.setOnClickListener {
            dismiss()
            submitCallback.invoke()
        }
    }

}